package com.zhaocheng.tank;

import java.io.IOException;
import java.util.Properties;

/**
 * @author zhaocheng
 * @version 1.0
 * @date 2020/6/28 0028 23:11
 */
public class ConfigMgr {
    static Properties properties = new Properties();
    static {
        try {
            properties.load(ConfigMgr.class.getClassLoader().getResourceAsStream("config"));
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

    public static Object get(String key){
        if (properties == null){
            return null;
        }
        return properties.get(key);
    }

    public static void main(String[] args) {
        System.out.println(ConfigMgr.get("initTankCount"));
    }
}
